// converter.aspx.cs
//
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class converter : System.Web.UI.Page
{
protected void Page_load(object sender, EventArgs e){

if  (this.IsPostBack==false)
  {
Currency.Items.Add(new ListItem("Euros","0.85"));
Currency.Items.Add(new ListItem("Japanese yen","110.33"));
Currency.Items.Add(new ListItem("Canadian Dollar","1.2"));
   }
 }


  protected void Convert_ServerClick(object sender, EventArgs e)
  {
  decimal Amount= decimal.Parse(US.Value);
  ListItem item = Currency.Items[Currency.SelectedIndex];

  decimal newAmount= Amount*decimal.Parse(item.Value);
  Result.InnerText=Amount.ToString()+ "US dollars =";
  Result.InnerText+=newAmount.ToString()+ " " + item.Text;
   }

}
